//
//  UIImage+ZBPod.m
//  ZBLanguageExtensions
//
//  Created by xzb on 2018/8/16.
//

#import "UIImage+ZBPod.h"

@implementation UIImage (ZBPod)

+ (UIImage *)zb_imageNamed:(NSString *)imageName inBundle:(NSString *)bundleName
{
    if (imageName.length == 0) {
        return nil;
    }
    if (bundleName.length == 0) {
        return [UIImage imageNamed:imageName];
    }
    NSURL *bundleURL = [[NSBundle mainBundle] URLForResource:bundleName withExtension:@"bundle"];
    NSBundle *bundle = [NSBundle bundleWithURL:bundleURL];
    UIImage *result = [self zb_internal_imageNamed:imageName inBundle:bundle];
    return result;
    
}

+ (UIImage *)zb_internal_imageNamed:(NSString *)imageName inBundle:(NSBundle *)bundle
{
    return [UIImage imageNamed:imageName inBundle:bundle compatibleWithTraitCollection:nil];
}

@end
